<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    
    <title>充值卡新增</title>
   <link href="${ctx}/style/style.css" rel="stylesheet" type="text/css" />
   <link type="text/css" rel="stylesheet"
			href="${ctx}/style/formValidataor/formValidator.css" />
	<script language="JavaScript" src="${ctx}/scripts/jquery.js"></script>
	<script type="text/javascript"
			src="${ctx}/scripts/formValidataor/formValidator.js"></script>
	<script type="text/javascript"
		src="${ctx}/scripts/formValidataor/formValidatorRegex.js"></script>
	<script type="text/javascript"
			src="${ctx}/scripts/lhgdialog/lhgdialog.js"></script>		
	<script type="text/javascript">
		$(document).ready(function(){
			$.formValidator.initConfig({formid:"myform",submitOnce:true,
			    onerror:function(msg){
			    	$("#btn").removeAttr("disabled",false);
			    	$.dialog.alert(msg);
			}});
			$("#oldPwd").formValidator({onshow:"请输入原密码",
		        onfocus:"请输入原密码",oncorrect:"原密码输入正确"})
		        .regexValidator({regexp:"notempty",datatype:"enum",onerror:"原密码不能为空"})
		        .functionValidator({fun:function(val,elem){
					if($("#oldPwdVal").val() == val){
						return true;
					}else{
						return false;
					}
				},onerror:"原密码输入错误"}); 
		    $("#newPwd").formValidator({onshow:"请输入新密码",
		        onfocus:"请输入新密码",oncorrect:"新密码输入正确"})
		        .regexValidator({regexp:"notempty",datatype:"enum",onerror:"新密码不能为空"});  
			$("#confirmPwd").formValidator({onshow:"请输入确认密码",
		        onfocus:"请输入确认密码",oncorrect:"确认密码输入正确"})
		        .regexValidator({regexp:"notempty",datatype:"enum",onerror:"确认密码不能为空"})
		        .functionValidator({fun:function(val,elem){
					if($("#newPwd").val() == val){
						return true;
					}else{
						return false;
					}
				},onerror:"两次密码输入不一致"});  
		});
		window.onload = function (){
			var msg = $("#msg").val();
			if(msg != ''){
				if(msg == '0'){
					$.dialog.alert("密码修改成功！");
				}else if(msg == '1'){
					$.dialog.alert("密码修改失败！");
				} 
			}
		}	
	</script>
 </head>
 <body>
 	<div class="place"  >
	    <span>位置：</span>
	    <ul class="placeul">
	    	<li><a href="#">密码修改</a></li>
	    </ul>
    </div>
    <div style="padding-left: 5%;">
    	<s:hidden id="msg" name="msg" />
	   	<form id="myform" name="myform"  action="Agentaccountinfo_pwdUpdate.action"  method="post" >
		    <table class="dataTable" cellpadding="0" cellspacing="0" width="600" height="150">
				<tr>
					<td align="right">原密码:</td>
					<td>
						<input type="password"  id="oldPwd" class="input" />
						<s:hidden id="oldPwdVal" name="sysUser.password" />
					</td>
					<td><div id="oldPwdTip"></div></td>
				</tr> 
				<tr>
					<td align="right">新密码:</td>
					<td><input type="password"  id="newPwd" name="code" class="input" /></td>
					<td><div id="newPwdTip"></div></td>
				</tr>   
				<tr>
					<td align="right">确认密码:</td>
					<td ><input type="password" id="confirmPwd" class="input" /></td>
					<td><div id="confirmPwdTip"></div></td>
				</tr>
				<tr>
					<td align="center" colspan="3">
						<input type="submit"  value="修改" class="btn" />
					</td>
				</tr>
		    </table>
		  </form> 
	</div> 
  </body>
</html>
